# Contributor: Galen Abell <galen@galenabell.com>
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=py3-nptyping
_pyname=nptyping
pkgver=2.5.0
pkgrel=3
pkgdesc="Type hints for Numpy"
url="https://github.com/ramonhagenaars/nptyping"
arch="noarch"
license="MIT"
depends="python3 py3-numpy"
makedepends="py3-setuptools py3-gpep517"
checkdepends="py3-pytest py3-typeguard py3-beartype py3-mypy py3-wheel py3-pandas"
subpackages="$pkgname-pyc"
source="$_pyname-$pkgver.tar.gz::https://github.com/ramonhagenaars/nptyping/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver"
options="!check" # FIXME! also look into the ignored tests below

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	# disable tests which require network or pyright (python wrapper for the type
	# checker implemented in js, which just downloads it using npx)
	#
	# mypy tests are currently broken as pandas doesn't package type hints
	.testenv/bin/python3 -m pytest \
		--ignore tests/test_wheel.py \
		--ignore tests/test_package_info.py \
		--ignore tests/test_pyright.py \
		--ignore tests/pandas_/test_fork_sync.py \
		--ignore tests/test_mypy.py \
		--ignore tests/pandas_/test_mypy_dataframe.py \
		--ignore tests/test_beartype.py
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
2cde9c5f7694d4f916b85c93b86df7f72709a70b2ffa91b7bbc98c5884236f5b36bb545a89c37e8c02a9b460065c97151d77c64f8d93b92fd93bcff406f039d9  nptyping-2.5.0.tar.gz
"
